package aufgabe01;

import java.util.ArrayList;

public class StackArray implements IStack {

	private ArrayList<Integer> stack = new ArrayList<Integer>();
	
	@Override
	public void clear()
	{
		stack.clear();
	}

	@Override
	public int getCount()
	{
		return stack.size();
	}

	@Override
	public int peek()
	{
		return stack.get(stack.size()-1);
	}

	@Override
	public int pop()
	{
		return stack.remove(stack.size()-1);
	}

	@Override
	public void push(int value)
	{
		stack.add(value);
	}
}
